﻿<caltech-header title="CustomerEquipment">
    <h3>Customer Equipment</h3>
</caltech-header>
<script type="text/ng-template" id="customTemplate.html">
    <a style="width: 500px; display: block;">
        <div class="row">
            <div class="col-xs-6">{{match.model.modelNumber}}</div>
            <div class="col-xs-6">{{match.model.manufacturer}}</div>
        </div>
    </a>
</script>
<div novalidate class="form form-horizontal" name="customerForm">
    <div class="form-group">
        <div class="col-xs-6">
            <label for="name">Customer</label>
            <span class="form-control-static">{{model.customer.name}}</span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-6">
            <label for="modelNumber">Model Number</label>

            <a href="#" e-typeahead="equipment as equipment.modelNumber for equipment in getEquipmentList($viewValue)" e-typeahead-editable="false"
               onaftersave="updateEquipmentItem($data)" editable-text="model.equipment.modelNumber" buttons="no" blur="submit" e-typeahead-template-url="customTemplate.html"><strong>{{model.equipment.modelNumber}}</strong></a>
        </div>
        
        <div class="col-xs-6">
            <label for="manufacturer">Manufacturer</label>
            <span class="form-control-static">{{model.equipment.manufacturer}}</span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-6">
            <label for="description">Range</label>
            <span class="form-control-static">{{model.equipment.description}}</span>
        </div>
        <div class="col-xs-6">
            <label for="procedure">Procedure</label>
            <span class="form-control-static">{{model.equipment.procedure}}</span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-6">
            <label for="name">Description</label>
            <span class="form-control-static">{{model.equipment.name}}</span>
        </div>
        <div class="col-xs-6">
            <label for="assetNumber">Asset Number</label>
            <span class="form-control-static">{{model.equipment.assetNumber}}</span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-6">
            <label for="serialNumber">Serial Number</label>
            <span class="form-control-static">{{model.equipment.serialNumber}}</span>
        </div>
        <div class="col-xs-6">
            <label for="poNumber">PO Number</label>
            <span class="form-control-static">{{model.equipment.poNumber}}</span>
        </div>
    </div>
    <div class="form-group spacing-bottom-md">
        <div class="col-xs-6">
            <label for="calibrationDate">Calibration Date</label>
            <a href="#" e-datepicker-popup="dd/MMM/yyyy" e-class="form-control" editable-bsdate="model.calibrationDate" buttons="no" e-name="calibrationDate" blur="submit">{{model.calibrationDate | date: 'dd/MMM/yyyy'}}</a>
        </div>
        <div class="col-xs-6">
            <label for="nextDueDate">Next Due Date</label>
            <a href="#" e-datepicker-popup="dd/MMM/yyyy" e-class="form-control" editable-bsdate="model.nextDueDate" buttons="no" e-name="nextDueDate" blur="submit">{{model.nextDueDate | date: 'dd/MMM/yyyy'}}</a>
        </div>
    </div>
    <div class="form-group spacing-bottom-md" has-access="Admin,Manager,Salesman">
        <div class="col-xs-6">
            <label for="calibrationDate">Unit Price</label>
            <a href="#" editable-text="model.price" e-class="form-control" buttons="no" e-name="price" blur="submit">{{model.price | number}}</a>
        </div>
    </div>
    <page-footer page="1"></page-footer>
</div>



<nav class="navbar navbar-default navbar-fixed-bottom navbar-inverse" role="navigation">
    <div class="container">
        <button class="btn btn-info navbar-btn" ng-click="back()">Back</button>
        <button class="btn btn-warning navbar-btn" has-access="Admin" busy-click="remove(model)" success="Deleted successfully" ng-show="model.id != undefined">Delete</button>
        <button class="btn btn-info navbar-btn" ng-show="model.id != undefined" ng-disabled="customerForm.$invalid" busy-click="update(model)" success="Updated successfully">Update</button>
        <button class="btn btn-info navbar-btn" ng-hide="model.id != undefined" ng-disabled="customerForm.$invalid" busy-click="save(model)" success="Created successfully">Save</button>
        <button class="btn btn-info navbar-btn" ng-show="model.id != undefined" ng-click="doPrint()"><i class="glyphicon glyphicon-print"></i> Print</button>
    </div>
</nav>